﻿using NExt.Core.Model.Base;

namespace NExt.form
{
    public abstract class TextField<TEvents> : Field<TEvents>
        where TEvents : TextFieldEvents, new()
    {
        public bool? allowBlank { get; set; }
        public string blankText { get; set; }
        public bool? disableKeyFilter { get; set; }
        public string displayField { get; set; }
        public bool? enableKeyEvents { get; set; }
        public string emptyClass { get; set; }
        public string emptyText { get; set; }
        public bool? grow { get; set; }
        public int? growMax { get; set; }
        public int? growMin { get; set; }
        public string maskRe { get; set; }
        public int? maxLength { get; set; }
        public string maxLengthText { get; set; }
        public int? minLength { get; set; }
        public string minLengthText { get; set; }
        public RegExp regex { get; set; }
        public string regexText { get; set; }
        public bool? selectOnFocus { get; set; }
        public IScript validator { get; set; }
        public string vtype { get; set; }
        public string vtypeText { get; set; }
    }

    public class TextField : TextField<TextFieldEvents>
    {
    }

    public class TextFieldEvents : FieldEvents
    {
        public IScript autosize { get; set; }
    }
}
